<template>
  <view class="search-field" :style="{'background-color': bgcolor}" @click="searchBoxClicked()">
    <view class="search-box" :style="{'border-radius' : radius + 'px'}">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"search_field",
    props:{
      //背景色
      bgcolor:{
        type: String,
        default:'#18BC37',
      },
      //圆角尺寸
      radius:{
        type: Number,
        default: 15
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      searchBoxClicked(){
        this.$emit("click")
      }
    }
  }
</script>

<style lang="scss">
.search-field{
  height:35px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  .search-box{
    height: 24px;
    background-color: #FFFFFF;
    display: flex;
    width: 100%;
    justify-content: center;
    align-content: center;
    .placeholder{
      font-size: 14px;
      margin-left: 5px;
    }
  }
}
</style>
